<template>
    <div>
      <form action="" @submit.prevent="on">
        <input type="text" v-model="name">
        <input type="submit" value="登录">
      </form>
    </div>
</template>

<script>
  import axios from 'axios'
    export default {
        name: "login",
      data(){
          return({
            name:""
          })
      },
      methods:{
          on(){
            axios({
              method:'post',
              url:'http://127.0.0.1:8000/login/',
              data:{
                name:this.name
              }
            }).then(res=>{
              this.$router.push('/show_ding')
            })
          }
      }
    }
</script>

<style scoped>

</style>
